/**
 * @description: 文件描述
 * @version: 0.0.1
 * @author: xxx
 * @Date: 2024-09-12 13:44:17
 */
import { defineAsyncComponent } from 'vue'

export default {
    install: (app) => {
        const modules = import.meta.glob('./**/*.vue')
        for (const [key, value] of Object.entries(modules)) {
            const str = value
            const arr = key.split('/')
            const name = arr[arr.length - 1].split('.')[0]
            app.component(name, defineAsyncComponent(str))
        }
    }
}
